import {createBrowserRouter} from 'react-router-dom'
import { lazy } from 'react'
import App from '../App'
const Data = lazy(() => import('../pages/data/Index'))
const Data1= lazy(() => import('../pages/data1/Index'))

type routsType = {
    path:string,
    element:JSX.Element,
    children?:{path:string,element:JSX.Element,}[]
}[]

const routes:routsType =[
   {
    path:'/',
    element:<App/>,
    children:[
        {
            path:'data',
            element:<Data/>
        },
        {
            path:'data1',
            element:<Data1/>
        }
    ]
   }
]
const router = createBrowserRouter(routes)
export default router